package com.zr.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.zr.service.HRServicedtp;
import com.zr.serviceImpl.HRServiceImpldtp;

public class EditeControllerdtp extends HttpServlet {
	HRServicedtp hr=new HRServiceImpldtp();
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		doPost(req, resp);
	}
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		req.setCharacterEncoding("utf-8");
		resp.setCharacterEncoding("utf-8");
		int eid=Integer.parseInt(req.getParameter("eid"));
		String mname=req.getParameter("mname");
		int mage=Integer.parseInt(req.getParameter("mage"));
		String meducation=req.getParameter("meducation");
		String mdizi=req.getParameter("mdizi");
		String mphone=req.getParameter("mphone");
		boolean flag=hr.editEmpl(eid, mname, mage, meducation, mdizi, mphone);
		PrintWriter pw=resp.getWriter();
		if(flag){
			pw.write("true");
		}else{
			pw.write("false");
		}
		pw.flush();
		pw.close();
	}
}
